@echo off

REM 使用 Maven Wrapper 命令
SET MVN_CMD=mvnw.cmd

REM 清理、运行测试并生成 Allure 报告数据
ECHO Running Maven tests and generating Allure results...
CALL "%MVN_CMD%" clean test

REM 检查上一步是否成功
IF %ERRORLEVEL% NEQ 0 (
    ECHO Maven tests failed. Aborting Allure serve.
    GOTO :EOF
)

REM 启动 Allure 报告服务
ECHO Serving Allure report...
CALL "%MVN_CMD%" allure:serve